package com.littleHan.brushQuestions.web.start.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TopicVo implements Comparable<TopicVo>{
    private String id;
    private String title;
    private String content;
    private String answer;
    private String userId;
    private String difficultyLevelId;
    private String topicTypeId;
    private String objectId;
    private String time;
    private int collectNum;
    private int commentNum;
    private boolean userIsCollect;

    //(评论加收藏最多的)
    @Override
    public int compareTo(TopicVo o) {
        if (this.collectNum+this.commentNum > o.collectNum+o.commentNum) {
            return -1;
        } else if (this.collectNum+this.commentNum < o.collectNum+o.commentNum) {
            return 1;
        } else {
            return 0;
        }
    }
}
